home *** CD-ROM | disk | FTP | other *** search
- /* CSAM_DSParseProc.c */
- /*
- * CSAM_DSParseProc.c
- * Copyright © 1992-93 Apple Computer Inc. All Rights Reserved.
- *
- * The CSAM Manager calls this function to process CSAM parse events. The simple
- * ones are handled immediately, while the complex calls (those that require
- * additional I/O operations) are handled via DirParseCommon().
- *
- * Edit History
- * 8-Jul-1993 MM DirFindRecordParse skeleton.
- */
- #include "DTSSampleCSAM.h"
- #ifdef THINK_C
- #include <ASM.h>
- #endif
-
- pascal OSErr
- CSAM_DSParseProc(
- register DTSSampleCSAMInfoPtr infoPtr,
- register DirParamBlockPtr pb,
- Boolean async
- )
- {
- short refNum;
- long saveA5;
-
- #ifdef THINK_C
- /*
- * Under Think C, we must save and set up the A4 parameter value.
- * This module must exit at the end of the function.
- */
- asm {
- move.l a4,-(sp)
- move.l infoPtr,a0
- move.l OFFSET(DTSSampleCSAMInfo,originalA4)(a0),a4
- }
- #endif
- STATUS = ioBusy;
- /*
- * Look at the request code. Handle the simple requests here: these cannot
- * initiate asychronous I/O. The hard ones are queued into the main handler.
- */
- switch (PARAM.header.reqCode) {
- case kDirGetDNodeAccessControlParse:
- case kDirGetAttributeAccessControlParse:
- case kDirGetRecordAccessControlParse:
- if (PARAM.header.reqCode == kDirGetDNodeAccessControlParse) {
- STATUS = GetRefNumFromRLI(
- infoPtr,
- PARAM.getDNodeAccessControlParsePB.pRLI,
- &refNum
- );
- }
- else {
- STATUS = GetRefNumFromRLI(
- infoPtr,
- PARAM.getRecordAccessControlParsePB.aRecord->rli,
- &refNum
- );
- }
- if (STATUS == noErr
- && PARAM.getRecordAccessControlParsePB.eachObject != NULL) {
- saveA5 = SetA5(PARAM.header.saveA5);
- (PARAM.getRecordAccessControlParsePB.eachObject) (
- PARAM.header.clientData,
- OCEGetAccessControlDSSpec(kMeMask),
- kMyAccessMask,
- kMyAccessMask,
- kMyAccessMask
- );
- SetA5(saveA5);
- }
- LogStatusX('ADAS', STATUS, "\pADASLookupAttributeValue err");
- CallCompletion((ParmBlkPtr) pb);
- break;
- default:
- /*
- * Call the hard stuff. These calls may initiate further I/O.
- * DirParseCommon returns ioBusy (== one) if it was called
- * asychronously and the request is pending. DirParseCommon
- * will call the user ioCompletion routine, if any.
- */
- DirParseCommon(infoPtr, pb, async);
- break;
- }
- #ifdef THINK_C
- asm {
- move.l (sp)+,a4
- }
- #endif
- return (STATUS);
- }